/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Ventana3.java
 *
 * Created on 07-may-2012, 13:20:43
 */
package gui;

import controles.ControlCreacion;

/**
 *
 * @author usuario_local
 */
public class Ventana3 extends javax.swing.JFrame {

    Ventana1 v1;
    
    /** Creates new form Ventana3 */
    public Ventana3(Ventana1 v1) {
        this.v1 = v1;
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jButton_v3personaje = new javax.swing.JButton();
        jButton_v3colectivo = new javax.swing.JButton();
        jButton_v3acontecimiento = new javax.swing.JButton();
        jButton_v3terminar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Añadir Nuevos");
        setName("Añadir Nuevos"); // NOI18N
        setResizable(false);

        jButton_v3personaje.setText("Añadir Personaje");
        jButton_v3personaje.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton_v3personajeMouseClicked(evt);
            }
        });

        jButton_v3colectivo.setText("Añadir Colectivo");
        jButton_v3colectivo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton_v3colectivoMouseClicked(evt);
            }
        });

        jButton_v3acontecimiento.setText("Añadir Acontecimiento");
        jButton_v3acontecimiento.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton_v3acontecimientoMouseClicked(evt);
            }
        });

        jButton_v3terminar.setText("Terminar");
        jButton_v3terminar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton_v3terminarMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jButton_v3personaje, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
            .addComponent(jButton_v3colectivo, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
            .addComponent(jButton_v3acontecimiento, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jButton_v3terminar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addComponent(jButton_v3personaje)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_v3colectivo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_v3acontecimiento)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_v3terminar, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton_v3terminarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_v3terminarMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        v1.setVisible(true);
        ControlCreacion.creando = ControlCreacion.Creacion.nada;
        this.dispose();
    }//GEN-LAST:event_jButton_v3terminarMouseClicked

    private void jButton_v3personajeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_v3personajeMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        Ventana4 v4 = new Ventana4(v1,this);
        v4.setPadre(1);
        v4.setVisible(true);
        ControlCreacion.creando = ControlCreacion.Creacion.personaje;
    }//GEN-LAST:event_jButton_v3personajeMouseClicked

    private void jButton_v3acontecimientoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_v3acontecimientoMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        Ventana4 v4 = new Ventana4(v1,this);
        v4.setPadre(3);
        v4.setVisible(true);
        ControlCreacion.creando = ControlCreacion.Creacion.acontecimiento;
    }//GEN-LAST:event_jButton_v3acontecimientoMouseClicked

    private void jButton_v3colectivoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton_v3colectivoMouseClicked
        // TODO add your handling code here:
        this.setVisible(false);
        Ventana4 v4 = new Ventana4(v1,this);
        v4.setPadre(2);
        v4.setVisible(true);
        ControlCreacion.creando = ControlCreacion.Creacion.colectivo;
    }//GEN-LAST:event_jButton_v3colectivoMouseClicked

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton_v3acontecimiento;
    private javax.swing.JButton jButton_v3colectivo;
    private javax.swing.JButton jButton_v3personaje;
    private javax.swing.JButton jButton_v3terminar;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}
